// HeaderComponent.scss
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(52, 69, 50);
  color: #fff;
  padding: 0 2rem;
  height: 4rem;

  @media (max-width: 768px) {
    flex-direction: column;
    align-items: flex-start; // 让内容靠左对齐
    height: auto; // 自适应高度
  }
}

.left-text {
  display: flex;
  align-items: center;

  h3 {
    width: 10rem;
    margin-left: 1rem;
    background-color: rgba(151, 206, 110);
    text-align: center;
  }

  @media (max-width: 768px) {
    flex-direction: column; // 在小屏幕上竖着排列
    h3 {
      margin-left: 0;
    }
  }
}

.right-content {
  display: flex;
  align-items: center;

  .time {
    margin-right: 1rem;
  }
  .userAvatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin-top: 1.5rem; // 使头像超出 Header 三分之一
    border-radius: 50%;
    overflow: hidden;
    background-color: gray; // 默认灰色背景
  }

  .avatar-uploader .ant-upload {
    width: 100%;
    height: 100%;
    border-radius: 50%;
  }

  .avatar-uploader img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }
  .user-icon {
    margin-left: 1rem;
  }

  @media (max-width: 768px) {
    flex-direction: column; // 在小屏幕上竖着排列
    .time {
      margin-right: 0;
    }
    .user-icon {
      display: none; // 隐藏图标
    }
    .userAvatar {
      margin-bottom: 4rem;
    }
  }
}
@media (max-width: 768px) {
  .ant-layout-header {
    align-items: center;
  }
}
